<template>
  <div class="page flex-col">
    <div class="group_1 flex-col">
      <div class="box_1 flex-col">
        <div class="group_2 flex-col">
          <div class="box_3 flex-col justify-end">
            <div class="group_4 flex-row">
              <a-button v-if="showChange&& roleType=='AGENCY'" @click="end()">开标结束</a-button>
              <h2 style="color:#fff;" v-if="!showChange">开标结束</h2>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import Vue from 'vue'

export default {
  components: {},
  data() {
    return {roleType: Vue.ls.get('User-Type'),
      showChange: false,
      constants: {},
    }
  },
created () {
    this.getData();
},
  methods: {
    getData() {
      this.$http.get('/exKaibiao/exSection/listAll', { params: { projectId: this.$route.query.projectId } }).then(r => {
        this.list = r.result
        this.list.forEach(item => {
          if (item.bidSectionId == this.$route.query.bidSectionId) {
            this.showChange = item.kaibiaoStatus == 1
          }
        })
      })
    },
    end() {
      this.$http.post('/exKaibiao/complete', { bidSectionId: this.$route.query.bidSectionId }).then(r => {
        this.showChange = true
      })
    },
    changeShow: function() {
      this.showChange = !!this.showChange
    },
  },
}
</script>
<style src="./common.css" />

<style scoped>
.page {
  position: relative;
  width: 100vw;

  overflow: hidden;
  .group_1 {

    background: #fff;
    width: 100vw;
    .box_1 {
      height: calc(100vh - 4.17vw);
      width: 100vw;
      .group_2 {
        position: relative;
        width: 100vw;
        height: 100%;
        background: rgb(6, 95, 222);

        .box_3 {
          background-color: rgba(3, 37, 146, 0.68);
          width: 93.75vw;

          margin: 3.17vw 0 3.12vw 3.12vw;
          .group_4 {
            position: relative;
            width: 77.77vw;
            height: 3.91vw;
            display: flex;
            justify-content: center;
            margin: 1.25vw 0 0 2.86vw;
            .text_9 {
              width: 8.55vw;
              height: 1.78vw;
              overflow-wrap: break-word;
              color: rgba(255, 255, 255, 1);
              font-size: 1.87vw;
              font-family: AlibabaPuHuiTi-Regular;
              font-weight: normal;
              text-align: left;
              white-space: nowrap;
              line-height: 1.88vw;
              margin-top: 1.05vw;
            }
            .box_4 {
              background-color: rgba(6, 95, 221, 1);
              width: 2.92vw;
              height: 3.91vw;
              margin-left: 1.62vw;
            }
            .box_5 {
              background-color: rgba(6, 95, 221, 1);
              width: 2.92vw;
              height: 3.91vw;
              margin-left: 2.5vw;
            }
            .box_6 {
              background-color: rgba(6, 95, 221, 1);
              width: 2.92vw;
              height: 3.91vw;
              margin-left: 2.5vw;
            }
            .text_10 {
              width: 11.93vw;
              height: 1.78vw;
              overflow-wrap: break-word;
              color: rgba(255, 255, 255, 1);
              font-size: 1.87vw;
              font-family: AlibabaPuHuiTi-Regular;
              font-weight: normal;
              text-align: left;
              white-space: nowrap;
              line-height: 1.88vw;
              margin: 1.25vw 0 0 4.53vw;
            }
            .box_7 {
              background-color: rgba(255, 207, 14, 1);
              width: 11.93vw;
              height: 0.37vw;
              margin: 1.97vw 0 0 2.78vw;
            }
            .box_8 {
              background-color: rgba(6, 95, 221, 1);
              width: 20.21vw;
              height: 0.37vw;
              margin-top: 1.98vw;
            }
            .text_11 {
              width: 3.34vw;
              height: 1.41vw;
              overflow-wrap: break-word;
              color: rgba(255, 255, 255, 1);
              font-size: 1.87vw;
              font-family: AlibabaPuHuiTi-Regular;
              font-weight: normal;
              text-align: left;
              white-space: nowrap;
              line-height: 1.88vw;
              margin: 1.61vw 0 0 2.29vw;
            }
            .text_12 {
              position: absolute;
              left: 10.68vw;
              top: 1.25vw;
              width: 11.52vw;
              height: 1.41vw;
              overflow-wrap: break-word;
              color: rgba(255, 255, 255, 1);
              font-size: 1.87vw;
              font-family: AlibabaPuHuiTi-Regular;
              font-weight: normal;
              text-align: left;
              white-space: nowrap;
              line-height: 1.88vw;
            }
          }
        }
      }
    }
  }
}
</style>
